<?php

namespace app\api\controller;

use app\admin\model\Transaction;
use app\admin\model\user\Balance;
use app\admin\model\user\Extend;
use app\common\controller\Api;

use app\common\library\Yunding;
use app\common\model\RechargeSetting;
use app\common\model\Third;
use Carbon\Carbon;
use EasyWeChat\Factory;
use think\Env;
use think\Log;

class Callback extends Api
{
    protected $noNeedLogin = ['Yunding', 'YundingEvent'];
    protected $noNeedRight = ['*'];


    public function Yunding()
    {
        $content  = file_get_contents("php://input");
        $data = json_decode($content, true);
//        if ('Password_Add_Service' == $data['service']) {
//            $serviceId  = $data['serviceid'];
//            $reserve = \app\admin\model\Reserve::where('yunding_serviceid', $serviceId)->find();
//            if ($reserve) {
//                $reserve->yunding_errno = $data['result']['ErrNo'];
//                $reserve->save();
//            }
//        }
        Log::record($content,'yunding');
        echo 'success';
    }

    public function YundingEvent()
    {
        $content  = file_get_contents("php://input");
        Log::record($content,'yunding_event');
        echo 'success';

    }
}


